package cn.yzfy.common.base.entity;

import com.baomidou.mybatisplus.annotation.FieldFill;
import com.baomidou.mybatisplus.annotation.TableField;
import lombok.Getter;
import lombok.Setter;

import java.io.Serial;
import java.time.LocalDateTime;

/**
 * 抽象id和创建时间、更新时间实体类基类
 */
@Getter
public abstract class AbstractIdAndTimeEntity extends AbstractIdEntity {
  
  @Serial
  private static final long serialVersionUID = 5484775255457031344L;
  
  /**
   * 创建时间
   */
  @Setter
  @TableField(value = "created_time", fill = FieldFill.INSERT)
  private LocalDateTime createdTime;
  
  /**
   * 更新时间
   */
  @Setter
  @TableField(value = "updated_time", fill = FieldFill.INSERT_UPDATE)
  private LocalDateTime updatedTime;
  
  // public void setCreatedTime(LocalDateTime createdTime) {
  //   this.createdTime = createdTime;
  // }
  
  // public void setUpdatedTime(LocalDateTime updatedTime) {
  //   this.updatedTime = updatedTime;
  // }
}